package com.ynny.service;
import com.ynny.dao.studentDao;
import com.ynny.entity.student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class studentServicelmpl implements studentService{

   @Autowired
   studentDao studentDao;


    @Override
    public int register(student student) {
        student student1 = studentDao.selectByPrimaryKey(student.getUsername());

        if (student1 == null) {
            return 0;
        }
            int i = studentDao.insert(student);
            if (i == 1) {
                return 1;
            }
            return i;

    }
}
